package com.luo.employee_oa.service.impl;

import com.luo.employee_oa.mapper.EmployeesMapper;
import com.luo.employee_oa.pojo.Employees;
import com.luo.employee_oa.service.EmployeesService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class EmployeesServiceImpl implements EmployeesService {
    private final EmployeesMapper employeesMapper;

    @Autowired
    public EmployeesServiceImpl(EmployeesMapper employeesMapper) {
        this.employeesMapper = employeesMapper;
    }


    @Override
    public List<Employees> inquireAboutAllEmployees() {
        return employeesMapper.inquireAboutAllEmployees();
    }

    @Override
    public Employees inquireAboutEmployeeById(Integer employeeId) {
        return employeesMapper.inquireAboutEmployeeById(employeeId);
    }

    @Override
    public Employees inquireAboutEmployeeByName(String name) {
        return employeesMapper.inquireAboutEmployeeByName(name);
    }

    @Override
    public Employees inquireAboutEmployeeByEmployeeNo(String employeeNo) {
        return employeesMapper.inquireAboutEmployeeByEmployeeNo(employeeNo);
    }

    @Override
    public int addEmployee(Employees employees) {
        return employeesMapper.addEmployee(employees);
    }
}
